﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <title>Word文件转换成PDF格式</title>
    <script type="text/javascript">
         //保存
        function Save() {
            var saveUrl = "/SaveAsPDF/SaveDoc";
            pageofficectrl.SaveFilePage = saveUrl;
            pageofficectrl.WebSave();
        }

        //另存为PDF文件
        function SaveAsPDF() {
            pageofficectrl.WebSaveAsPDF();
            alert("PDF文件已经保存到项目的wwwroot/SaveAsPDF/doc/目录下。");
            //location.href="OpenPDF.aspx?fileName=<%=pdfName %>";
        }

        function OnPageOfficeCtrlInit() {
            pageofficectrl.AddCustomToolButton("保存", "Save()", 1);
            pageofficectrl.AddCustomToolButton("另存为PDF文件", "SaveAsPDF()", 19);
        }

    </script>
</head>
<body>
    <form id="form1">
        <div style="width: auto; height: 900px;">
            @Html.Raw(ViewBag.poCtrl)
        </div>
    </form>
</body>
</html>